const express = require('express');
const router = new express.Router();

/**
 * @param {Object} options
 * @param {} options.dealerId 总代Id
 * @param {} options.brandId 品牌Id
 * @param {} options.code 编号
 * @param {} options.status 价格条款  1-申请排柜  2-柜图导入
 * @param {} options.pageSize 每页数据量
 * @param {} options.pageIndex 指定页
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/', async(req, res, next) => {
    const options = {
        dealerId: req.query.dealerId,
        brandId: req.query.brandId,
        code: req.query.code,
        status: req.query.status,
        pageSize: req.query.pageSize,
        pageIndex: req.query.pageIndex,
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    id: 'id25',
                    dealerCode: 'dealerCode26',
                    dealerName: 'dealerName27',
                    code: 'code28',
                    containerNo: 'containerNo',
                    cabinetType: 1,
                    status: 1,
                    packingListLength: 1,
                    options: [
                        'update',
                        'edit',
                    ]
                },
                {
                    id: 'id29',
                    dealerCode: 'dealerCode30',
                    dealerName: 'dealerName31',
                    code: 'code32',
                    containerNo: 'containerNo',
                    cabinetType: 1,
                    status: 1,
                    packingListLength: 1,
                    options: [
                        'update',
                        'edit',
                    ]
                }
            ],
            pageIndex: null,
            pageSize: null,
            sort: null,
            totalElements: 50,
            totalPages: null
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 备件排柜单Id
 * @throws {Error}
 * @return {Promise}
 */
router.get('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message',
        payload: {
            id: 'id33',
            dealerId: 'dealerId34',
            dealerCode: 'dealerCode34',
            dealerName: 'dealerName35',
            country: 'country',
            containerNo: 'containerNo',
            cabinetType: 1,
            rowVersion: 'rowVersion',
            options: [
                'update',
                'edit',
            ],
            attachments: [
                {
                    fileId: 'fileId36',
                    fileName: 'fileName37'
                },
                {
                    fileId: 'fileId38',
                    fileName: 'fileName39'
                }
            ],
            details: [
                {
                    packingListId: 'packingListId40',
                    packingCode: 'packingCode41',
                    packingListCodes: 'packingCode-palletCode,packingCode2-palletCode2',
                    packingType: 1,
                    container: 'container',
                    status: 1,
                    length: 1,
                    width: 1,
                    height: 1,
                    volume: 1,
                    netWeight: 1,
                    grossWeight: 1,
                    pickingListCodes: 'pickingListCodes1,pickingListCodes2,pickingListCodes3,pickingListCodes4',
                    packingListDetails: [
                        {
                            partSaleOrderCode: 'partSaleOrderCode89',
                            partOrderTypeCode: 'partOrderTypeCode90',
                            partOrderTypeName: 'partOrderTypeName91',
                            currency: 1,
                            transportType: 1,
                            pickingListCode: 'pickingListCode92',
                            partCode: 'partCode93',
                            partName: 'partName94',
                            oldPartCode: 'oldPartCode95',
                            oldPartName: 'oldPartName96',
                            quantity: 1,
                            price: 1,
                            totalAmount: 1
                        },
                        {
                            partSaleOrderCode: 'partSaleOrderCode89',
                            partOrderTypeCode: 'partOrderTypeCode90',
                            partOrderTypeName: 'partOrderTypeName91',
                            currency: 1,
                            transportType: 1,
                            pickingListCode: 'pickingListCode392',
                            partCode: 'partCode393',
                            partName: 'partName394',
                            oldPartCode: 'oldPartCode395',
                            oldPartName: 'oldPartName396',
                            quantity: 1,
                            price: 1,
                            totalAmount: 1
                        },
                        {
                            partSaleOrderCode: 'partSaleOrderCode89',
                            partOrderTypeCode: 'partOrderTypeCode90',
                            partOrderTypeName: 'partOrderTypeName91',
                            currency: 1,
                            transportType: 1,
                            pickingListCode: 'pickingListCode292',
                            partCode: 'partCode293',
                            partName: 'partName294',
                            oldPartCode: 'oldPartCode295',
                            oldPartName: 'oldPartName296',
                            quantity: 1,
                            price: 1,
                            totalAmount: 1
                        },
                        {
                            partSaleOrderCode: 'partSaleOrderCode89',
                            partOrderTypeCode: 'partOrderTypeCode90',
                            partOrderTypeName: 'partOrderTypeName91',
                            currency: 1,
                            transportType: 1,
                            pickingListCode: 'pickingListCode192',
                            partCode: 'partCode1393',
                            partName: 'partName1394',
                            oldPartCode: 'oldPartCode1395',
                            oldPartName: 'oldPartName1396',
                            quantity: 1,
                            price: 1,
                            totalAmount: 1
                        },
                        {
                            partSaleOrderCode: 'partSaleOrderCode97',
                            partOrderTypeCode: 'partOrderTypeCode98',
                            partOrderTypeName: 'partOrderTypeName99',
                            currency: 1,
                            transportType: 1,
                            pickingListCode: 'pickingListCode100',
                            partCode: 'partCode1201',
                            partName: 'partName1202',
                            oldPartCode: 'oldPartCode1203',
                            oldPartName: 'oldPartName1204',
                            quantity: 1,
                            price: 1,
                            totalAmount: 1
                        },
                        {
                            partSaleOrderCode: 'partSaleOrderCode97',
                            partOrderTypeCode: 'partOrderTypeCode98',
                            partOrderTypeName: 'partOrderTypeName99',
                            currency: 1,
                            transportType: 1,
                            pickingListCode: 'pickingListCode200',
                            partCode: 'partCode2101',
                            partName: 'partName2102',
                            oldPartCode: 'oldPartCode2103',
                            oldPartName: 'oldPartName2104',
                            quantity: 1,
                            price: 1,
                            totalAmount: 1
                        }
                    ]
                },
                {
                    packingListId: 'packingListId47',
                    packingCode: 'packingCode48',
                    pickingListCode: 'pickingListCode49',
                    palletCode: 'palletCode50',
                    packingType: 1,
                    container: 'container',
                    status: 1,
                    length: 1,
                    width: 1,
                    height: 1,
                    volume: 1,
                    netWeight: 1,
                    grossWeight: 1,
                    pickingListCodes: '19BH-E052-A-P1',
                    packingListDetails: [
                        {
                            partSaleOrderCode: 'partSaleOrderCode42',
                            currency: 1,
                            transportType: 1,
                            partCode: 'partCode43',
                            partName: 'partName44',
                            oldPartCode: 'oldPartCode45',
                            oldPartName: 'oldPartName46',
                            quantity: 1,
                            price: 1,
                            totalAmount: 1
                        }
                    ]
                }
            ]
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 备件排柜单Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
module.exports = router;
